<template>
    <div class="related-content">
        <div class="title">What's new</div>
        <el-row :gutter="24">
            <el-col :xs="12" :sm="12" :md="6" :lg="6" :xl="6" v-for="item of relatedData" class="hidden-xs600-and-down" :key="'related-col' + item.id">
                <div class="related-content-item">
                    <a class="related-content-item__link" target>
                        <el-image fit="cover" :src="item.img"></el-image>
                    </a>
                    <div class="related-content-item__text">{{ item.text }}</div>
                </div>
                <el-divider class="hidden-md-and-up"></el-divider>
            </el-col>
            <el-col :xs="24" :sm="24" class="hidden-xs600-and-up" v-for="item of relatedData" :key="'related-col-xs' + item.id">
                <div class="related-content-item">
                    <a class="related-content-item__link" target>
                        <el-image fit="fill" :src="item.img"></el-image>
                    </a>
                    <div class="related-content-item__text">{{ item.text }}</div>
                </div>
                <el-divider class="hidden-md-and-up"></el-divider>
            </el-col>
        </el-row>
        <p class="ptags-small">
            <a class="p related-content__footer_link" target="" data-analytics-tracking-event="link_click"
                data-analytics-link-type="Related Content" data-analytics-link-name="More Insights from G  E"
                data-analytics-link-title="">More Insights from G  E<svg id="Layer_1" data-name="Layer 1"
                    xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
                    <g id="Caret_Right_-_32" data-name="Caret Right - 32">
                        <path
                            d="M11,30a1,1,0,0,1-.71-.29,1,1,0,0,1,0-1.42L22.59,16,10.29,3.71a1,1,0,0,1,1.42-1.42l13,13a1,1,0,0,1,0,1.42l-13,13A1,1,0,0,1,11,30Z">
                        </path>
                    </g>
                </svg>
            </a>
        </p>
    </div>
</template>
<script setup>
let relatedData = ref([
    {
        id: '1',
        url: 'https://www.gehealthcare.com/insights/article/innovation-to-solve-the-healthcare-challenges-of-today%2c-tomorrow%2c-and-well-into-the-future-rsna-2023',
        img: new URL(`@/assets/home/img_0041.avif`, import.meta.url).href,
        text: 'Innovation to Solve the Healthcare Challenges of Today, Tomorrow, and Well Into the Future: RSNA 2023'
    },
    {
        id: '2',
        url: 'https://www.gehealthcare.com/insights/article/innovating-to-improve-efficiency-and-address-the-complexities-of-managing-patient-care',
        img: new URL(`@/assets/home/img_0064.avif`, import.meta.url).href,
        text: 'Innovating to Improve Efficiency and Address the Complexities of Managing Patient Care'
    },
    {
        id: '3',
        url: 'https://www.gehealthcare.com/insights/article/breathing-easier-how-ai-is-aiding-in-identifying-the-world%E2%80%99s-deadliest-cancer',
        img: new URL(`@/assets/home/clinician-and-software-fg-v1.avif`, import.meta.url).href,
        text: 'Breathing Easier: How AI Is Aiding in Identifying the World’s Deadliest Cancer'
    },
    {
        id: '4',
        url: 'https://www.gehealthcare.com/insights/article/health-or-high-water-how-japan%E2%80%99s-%E2%80%98jet-ski-doctor%E2%80%99-cares-for-the-elderly-on-remote-islands',
        img: new URL(`@/assets/home/gehcreports-jet-ski---story-2-v1.avif`, import.meta.url).href,
        text: 'Health or High Water: How Japan’s ‘Jet Ski Doctor’ Cares for the Elderly on Remote Islands'
    }
])
</script>
<style lang="scss" scoped>
.related-content {
    box-sizing: border-box;
    margin: 0 auto;
    padding: 24px;
    max-width: 1280px;
    padding-top: 48px;
    padding-bottom: 48px;
    .title {
        margin-bottom: 32px;
        font-size: 1rem;
        line-height: 1.5rem;
        letter-spacing: .36px;
        font-weight: 600;
    }

    .related-content-item {
        display: block;
        .related-content-item__link {
            display: block;
            overflow: hidden;
            border-radius: 8px;
            width: 100%;
            .el-image {
                transform: scale(1.0);
                aspect-ratio: 1/0.5625;
                transition: all 1s;
                vertical-align: middle;
            }
            &:hover{
                .el-image{
                    transform: scale(1.2)
                }
            }
        }

        .related-content-item__text {
            margin-top: 16px;
            margin-bottom: 16px;
            font-size: 1rem;
            line-height: 1.5rem;
        }
    }
    .ptags-small{
        .related-content__footer_link {
            line-height: 1.5rem;
            display: inline-block;
            margin-top: 48px;
            white-space: pre;
            color: var(--interaction);
            &:hover{
                text-decoration: underline;
            }
            svg {
                margin-left: 8px;
                fill: var(--interaction)!important;
                width: 14px;
                height: 14px;
                vertical-align: middle;
            }
        }
    }
}
@media (max-width: 768px) {
    .related-content .title{
        margin-bottom: 24px;
        font-size: 0.875rem;
        line-height: 1.25rem;
    }
    .related-content__footer_link{
        margin-top: 33px !important; 
    }
}

@media (max-width: 992px) {
    .related-content-item{
        display: flex !important;
        align-items: center !important;
    }
    .related-content-item__link{        
        width: 80px !important;
        height: 80px !important;
        margin-right: 10px !important;
        .el-image{
            aspect-ratio: 1/1 !important;
        }
    }
    .related-content-item__text{
        flex: 1;
    }
}
@media (min-width: 600px) {
    .hidden-xs600-and-up{
        display: none !important;
    }
    .hidden-xs600-and-down{
        display: flex !important;
        justify-content: space-between;
        flex-direction: column;
    }
}
@media (max-width: 600px) {
    .hidden-xs600-and-up{
        display: block !important;
    }
    .hidden-xs600-and-down{
        display: none !important;
    }
}
</style>